package sojo.com.inverter.enums;


/**
 * @author cheng_hu
 * @description: 告警1
 * @date 2023-02-25 14:04:43
 */
public enum AlarmEnum_4 {
    Alarm_0(0, 2004, "直流过压", "重要"),
    Alarm_1(1, 2005, "直流反接", "重要"),
    Alarm_2(2, 2006, "直流短接或反接", "重要"),
    Alarm_3(3, 2007, "直流串接", "重要"),
    Alarm_4(4, 2008, "直流未可靠连接", "重要"),
    Alarm_5(5, 2095, "管理系统证书未生效", "提示"),
    Alarm_6(6, 2096, "管理系统证书即将过期", "提示"),
    Alarm_7(7, 2097, "管理系统证书已过期", "重要"),
    Alarm_8(8, 2098, "并机通信异常", "重要"),
    Alarm_9(9, 2099, "近端接入证书未生效", "提示"),
    Alarm_10(10, 2100, "近端接入证书即将过期", "提示"),
    Alarm_11(11, 2101, "近端接入证书已过期", "重要"),
    Alarm_12(12, 2041, "交流侧相序反", "重要"),
    Alarm_13(13, 2009, "组串对地短路", "重要"),
    Alarm_14(14, 2102, "通信断链失效保护", "提示"),
    Alarm_15(15, 2103, "交流端子温度异常", "重要");


    private int bit; //bit值
    private int alarmId; //告警ID
    private String alarmName; //告警名称
    private String alarmLevel; //告警级别
    AlarmEnum_4(int bit, int alarmId, String alarmName, String alarmLevel) {
        this.bit = bit;
        this.alarmId = alarmId;
        this.alarmName = alarmName;
        this.alarmLevel = alarmLevel;
    }

    public static String getAlarmName(int bit) {
        for (AlarmEnum_4 alarmEnum : AlarmEnum_4.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmName();
            }
        }
        return "";
    }

    public static int getAlarmId(int bit) {
        for (AlarmEnum_4 alarmEnum : AlarmEnum_4.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmId();
            }
        }
        return -1;
    }

    public static String getAlarmLevel(int bit) {
        for (AlarmEnum_4 alarmEnum : AlarmEnum_4.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmLevel();
            }
        }
        return "";
    }

    public String getAlarmLevel() {
        return alarmLevel;
    }

    public void setAlarmLevel(String alarmLevel) {
        this.alarmLevel = alarmLevel;
    }

    public int getBit() {
        return bit;
    }

    public void setBit(int bit) {
        this.bit = bit;
    }

    public int getAlarmId() {
        return alarmId;
    }

    public void setAlarmId(int alarmId) {
        this.alarmId = alarmId;
    }

    public String getAlarmName() {
        return alarmName;
    }

    public void setAlarmName(String alarmName) {
        this.alarmName = alarmName;
    }
}
